/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package muhnes.sizoo.consulta;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.model.SelectItem;

public class CampoFormulario implements Serializable {   
  
    private String id;
    private String name;
    private Object value;  
    private boolean required;  
    private List<SelectItem> selectItems;  
    private Map<String,String> parametros;
  
    public CampoFormulario(String id, String name, boolean required) {  
        this.id = id;
        this.name = name;
        this.required = required;  
        parametros = new HashMap<String,String>();
    }  
  
    public CampoFormulario(String id, String name, Object value, boolean required) {  
        this.id = id;
        this.name = name;
        this.value = value;  
        this.required = required; 
        parametros = new HashMap<String,String>();
    }  
    
    public CampoFormulario(String id, String name, Object value, boolean required, Map<String,String> parametros ) {  
        this.id = id;
        this.name = name;
        this.value = value;  
        this.required = required; 
        this.parametros = parametros;
    } 
  
    public CampoFormulario(String id, String name, Object value, boolean required, List<SelectItem> selectItems) {  
        this.id = id;
        this.name = name;
        this.value = value;  
        this.required = required;  
        this.selectItems = selectItems;  
        parametros = new HashMap<String,String>();
    }
    
    public CampoFormulario(String id, String name, Object value, boolean required, List<SelectItem> selectItems, Map<String,String> parametros) {  
        this.id = id;
        this.name = name;
        this.value = value;  
        this.required = required;  
        this.selectItems = selectItems;  
        this.parametros = parametros;
    }
    
    public String getId() {
        return id;
    }
    
    public String getName() {
        return name;
    }
  
    public Object getValue() {  
        return value;  
    }  
  
    public void setValue(Object value) {  
        this.value = value;  
    }  
  
    public boolean isRequired() {  
        return required;  
    }    
  
    public List<SelectItem> getSelectItems() {  
        return selectItems;  
    }
    
    public Map<String,String> getParametros() {
        return parametros;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CampoFormulario other = (CampoFormulario) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 61 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }
    
}  
